\documentclass{article}
\usepackage{tikz}
\usepackage{pgfplots}
\usepackage{amsmath}
\begin{document}
  \title{The Geometry of Linear Equation}
  \author{ZhuJunyi}
  \date{\today}
  \maketitle
  \section{Introduce}
  Given a linear equations set, for example:
  \[
  \begin {array}{l}
    2x -  y = 0 \\
    -x + 2y = 3
  \end {array}
  \]
  can be written as:
  \begin{equation}
  \begin{bmatrix}
    2 & -1 \\
    -1 & 2 
  \end{bmatrix}
  \begin{bmatrix}
    x \\ y
  \end{bmatrix}
  =
  \begin{bmatrix}
    0 \\ 3
  \end{bmatrix}
  \label{con:rowpic}
  \end{equation}
  where \begin{bmatrix}
    2 & -1 \\
    -1 & 2
  \end{bmatrix}
  can be called $A$, while \begin{bmatrix}
    x \\ y
  \end{bmatrix}
  can be called $\textbf{x}$,the result vector $ \begin{bmatrix} 0 \\ 3 \end{bmatrix} $ called $b$. \\
  In this way, we can call (\ref{con:rowpic}) as a \textbf{row picture} of the linear equation. \\
  So what is the geometry meaning of row picture?\\
  In this example, we have 2 row, in each row it represents a line:\\
  \begin{figure}[h]
    \centering
    \resizebox{0.5\columnwidth}{!}{
    \begin{tikzpicture}[domain=-2:3]
      %draw the axis
      \draw[very thin,color=gray](-2,-2)grid(3,3)
      \draw[eaxis] (-2,0) -- (3,0) node[right] {$x$};
      \draw[eaxis] (0,-2) -- (0,3) node[above] {$y$};
      %draw line
      \clip (-2,-2) rectangle(3,3)
      \draw[color=orange] plot(\x,2*\x) node[right,pos=0.2] {-2x + y = 0};
      \draw[color=cyan] plot(\x,1.5+\x/2) node[left,pos=0] {-x + 2y = 3};
    \end{tikzpicture}}
  \end{figure}
\\
  If we rewrite (\ref{con:rowpic}) in to:
  \[
  \begin {equation}
  x \begin{bmatrix}
    2 \\ -1
  \end{bmatrix}
  +
  y \begin{bmatrix}
    -1 \\ 2
  \end{bmatrix}
  =
  \begin{bmatrix}
    0 \\ 3
  \end{bmatrix}
  \label{con:colpic}
  \end{equation}
  \]
  that is called \textbf{column picture}.
  In row picture, it's asking us to find to solution of the linear equations, while in column picture, it's asking us to find a way to make vector $ \begin{bmatrix}
    2 \\ -1
  \end{bmatrix}$ and $ \begin{bmatrix}
    -1 \\ 2
  \end{bmatrix}$ amounts to get $ \begin{bmatrix}
    0 \\ 3
  \end{bmatrix}$, in other words, to find the right linear combination of the columns.\\
  \begin{figure}[h]
    \centering
    \resizebox{0.5\columnwidth}{!}{
        \begin{tikzpicture}[scale=0.5]
          %draw the axis
          \draw[very thin,color=gray](-2,-1)grid(2.5,4)
          \draw[->] (-2,0) -- (3,0) node[right] {$x$};
          \draw[->] (0,-2) -- (0,3) node[above] {$y$};
          \draw[line width = 2,color=cyan,-stealth](0,0)--(2,-1) node[above]{$\vec{x}$}; 
          \draw[line width = 2,color=orange,-stealth](0,0)--(-1,2) node[above]{$\vec{y}$};
          
          \draw[line width = 1,color=orange,-stealth](0,0)--(-2,4) node[above]{$2*\vec{y}$};
          \draw[line width = 2,color=red,-stealth](0,0)--(0,3) node[above]{$2\times\vec{y}+\vec{x}$};
        \end{tikzpicture}
    }
  \end{figure}
  \\For 3 dimension matrices and vectors, one linear equation in a row will represents a plane, while the vector in the column picture will represents a line.
  \section{Existence of solution}%
  \label{sec:Existence of solution}
  In the example above, we can easily find the solution of the linear equations, but what if the linear equations set has no solution?\\
  How can we tell if a linear equations set has a solution?\\
  Consider the column picture of a linear equation set, it is consist of a group of vectors. The rhs $b$ is also a vector. When we can't find a combination of lhs vectors to mate the rhs, that's when we don't have a solution.\\
  In later chapters, we will discuss a systematic way to solve, and to tell if a linear equations set has a solution.

\end{document}

